import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

function route(path, file, name, children, kk) {
  return {
    exact: true,
    path,
    name,
    children,
    component:() => import('@/pages'+file) ,
    meta: {keepAlive: kk}
  }
}


export default new Router({
  mode: 'history',
  routes: [
    route("/login", '/login', "Login"),
    {
      path: '/',
      name: 'index',
      component: resolve=>(require(["@/pages/index"],resolve)),

      redirect: "/student/index/achievements",
      children: [ // 其它所有组件都是 Layout的子组件
        route("/student/index/thesis", "/items/thesis", "thesis"),
        route("/student/index/statistics", "/items/Statistics", "Statistics"),
        route("/student/index/personal_information", "/items/Personal_information", "Personal_information"),
        route("/student/index/achievements", "/items/Achievements", "Achievements","",true),
        route("/student/index/addthesis", "/items/Addthesis", "Addthesis"),
        route("/student/index/AddAchievements", "/items/AddAchievements", "AddAchievements","",false),
        route("/student/index/lookthesis", "/items/lookthesis", "lookthesis"),
        route("/student/index/information", '/items/information', "information"),
        route("/student/index/homemain", '/items/HomeMain', "HomeMain"),
        route("/student/index/notify", '/items/notify', "notify"),
        route("/student/index/StuDoTask", '/items/StuDoTask', "StuDoTask"),
        route("/student/index/LookStuTask", '/items/LookStuTask', "LookStuTask"),
        route("/student/index/CheckStuTask", '/items/CheckStuTask', "CheckStuTask"),
        route("/student/graduationproject/viewtasks", '/Graduationproject/Viewtasks', "Viewtasks"),
        route("/student/graduationproject/TeaViewtasks", '/Graduationproject/TeaViewtasks', "TeaViewtasks"),
        route("/student/graduationproject/Addtask", '/Graduationproject/Addtask', "Addtask"),
        route("/student/graduationproject/looktask", '/Graduationproject/LookTask', "LookTask"),



      //教师端D:\WebProject\managementweb\src\pages\items\StuDoTask.vue
        route("/teacher/index/statistics", "/items/Statistics", "TStatistics"),
        route("/teacher/index/achievements", "/items/Achievements", "TAchievements","",true),
        route("/teacher/index/personal_information", "/items/Personal_information", "TPersonal_information"),
        route("/teacher/index/teacherthesis", '/teacher/TeacherThesis', "TeacherThesis"),

        route("/teacher/index/guidance", '/teacher/guidance', "guidance"),
        route("/teacher/index/addTopic", '/teacher/addTopic', "addTopic","",false),
        route("/teacher/index/StudentProgress", '/teacher/StudentProgress', "StudentProgress"),
        route("/teacher/index/PublishTask", '/teacher/PublishTask', "PublishTask"),
        route("/teacher/index/CheckTask", '/teacher/CheckTask', "CheckTask"),
        route("/teacher/index/CheckStudent", '/teacher/CheckStudent', "CheckStudent"),
        route("/teacher/index/TeaUpdateTask", '/teacher/TeaUpdateTask', "TeaUpdateTask"),
        route("/teacher/Achievenments/CheckAch", '/Achievenments/CheckAch', "CheckAch"),
      //  管理员用户
        route("/admin/index/adduser", '/admin/addUser', "addUser"),

      ]
    }
  ]
})
